﻿@using PagedList
@using PagedList.Mvc
@{
    string[] align = { "left", "middle", "right" };
    for (int i = 0; i < ViewBag.pages.Count; i++)
    {
        if (i % 3 == 0)
        {
    <div class="clear">
    </div>
            if (i > 0)
            {
    <div id="space">
    </div>
            }
        }
    <div class="grid_4 column">
        <div class="@align[i % 3]">
            <p class="header">
                <a href="@Url.Action("Page")/@ViewBag.Pages[i].Id">
                    @ViewBag.Pages[i].Title
                </a>
            </p>
            <div class="separator">
            </div>
            <p>@ViewBag.Pages[i].Description</p>
            <p class="more">
                <a href="@Url.Action("Page")/@ViewBag.Pages[i].Id" class="orange_link">READ </a>
            </p>
        </div>
    </div>
    }
}
<div class="clear">
</div>
<div class="center">
    <ul class="pages-list">
        @if (ViewBag.pages.PageCount > 1)
        {
            Write(Html.PagedListPager((IPagedList)ViewBag.pages,
                                      page => Url.Action(ViewBag.pagedUrl,
                                      new { page })));
        }
    </ul>
</div>
